#!/bin/bash

exit
pages=2
for i in $(seq $pages)
do
    curl -s http://www.xicidaili.com/nn/$i \
        | egrep -B1 '<td>[0-9]+</td>'                               \
        | sed -r -e 's/<td>([0-9]+.[0-9]+.[0-9]+.[0-9]+).*/\1:/'    \
                 -e '/--/d'                                         \
                 -e 's/<td>//'                                      \
                 -e 's/<\/td>/#/'                                   \
                 -e 's/^ +//'                                       \
        | tr -d '\n'                                                \
        | sed -e 's/#/\n/g'
done
